<template>
  <div class="wrap">
    <!-- <div class="wrap_main"> -->
    <!-- <el-breadcrumb
        separator="/"
        v-if="currentPage === 'add'"
      >
        <el-breadcrumb-item
          :class="{ clickable: currentPage !== 'list' }"
          @click.native="handleListBreadcrumbClick"
          >固定项目管理</el-breadcrumb-item
        >
        <el-breadcrumb-item v-if="currentPage === 'add'">{{
          title
        }}</el-breadcrumb-item>
      </el-breadcrumb> -->
    <router-view></router-view>
    <!-- <Add
        v-if="
          currentPage === 'add' || currentPage === 'edit'
        "
        :detailData="detailData"
        :isView="isView"
        @handleSuccessAdd="handleSuccessAdd"
      />

      <List
        v-if="currentPage === 'list'"
        ref="listRef"
        @addProject="addProject"
        @updateProgress="updateProgress"
        @viewProject="viewProject"
        @checkProject="checkProject"
      /> -->
    <!-- </div> -->
  </div>
</template>

<script>
import Icon from '@/components/icon'
import Add from './components/add.vue'
import List from './components/list.vue'
import Breadcrumb from '@/components/breadcrumb/index.vue'
import Utool from '@/components/utool/index-land'

export default {
  name: 'index',
  components: {
    Icon,
    Add,
    List
  },
  data() {
    return {
      currentPage: 'list',
      detailData: {},
      title: '',
      isView: false,
      isCheck: false
    }
  },
  computed: {},
  mounted() {},
  methods: {
    handleListBreadcrumbClick() {
      this.currentPage = 'list'
    },
    addProject() {
      this.title = '新增'
      this.currentPage = 'add'
      this.detailData = {}
      this.isView = false
      this.isCheck = false
    },
    handleSuccessAdd() {
      this.currentPage = 'list'
      // this.$refs.listRef.refresh()
    },
    updateProgress(row) {
      this.title = '编辑'
      this.detailData = row
      this.currentPage = 'add'
      this.isView = false
      this.isCheck = false
    },
    viewProject(row) {
      this.title = '查看'
      this.detailData = row
      this.currentPage = 'add'
      this.isView = true
      this.isCheck = false
    },
    checkProject(row) {
      this.title = '审核'
      this.detailData = row
      this.currentPage = 'add'
      this.isView = false
      this.isCheck = true
    }
  }
}
</script>

<style scoped lang="scss">
.wrap {
  box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 15px;
  box-sizing: border-box;
}
</style>
